home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-02 | 2.3 KB | 88 lines | [TEXT/????] |
- NB. utilities for script files
- NB.
- NB. script utilities assume files have extension: .js
- NB. and by default use directory: examples
- NB.
- NB. builds builds a script file from several script files
- NB. prints print script file (requires Windows MS Write)
- NB. reads read script file
- NB.
- NB. gets get script ...is defined in init.js
- NB.
- NB. prfiles print files (called by prints)
-
- SCRIPTNAMES=: 'builds prfiles prints reads'
-
- NB. builds
- NB. newfile builds oldfiles
- builds=: 0 : 0
- :
- dat=. 1!:1&< &. > }.0;y.
- dat=. ;(,&LF @ toLF) &.> dat
- delnb=. #~ -.@(+./\)@('NB.'&E.)
- dat=. delnb &.> < ;._2 dat
- dat=. ; (,&CRLF)&.>dat
- dat 1!:2 }.0;x.
- )
-
- NB. prfiles
- NB. print script files
- NB.
- NB. Note: requires Windows MS Write. If not available, modify
- NB. the definition accordingly.
- NB.
- prfiles=: 0 : 0
- $.=. >(16<3!:0 y=. y.){$.;L0
- y=. <;._1 ' ',y
-
- L0) CRLF2=. CRLF,CRLF
- dat=. read &.> y
- del=. }.~ _2&*@(CRLF2&-:)@(_4&{.)
- dat=. del &.> dat
- y=. 'File: '&, &.> ,&CRLF2 &.> y
- dat=. y ,&.> dat
- line=. CRLF,(80$196{a.),CRLF2
- dat=. dat ,&.> <line
- dat=. (-#line) }. ;dat
-
- dat write scratch=. 'c:\prints.tmp'
- wddl=. 6!:3@(1&[) @ wd
-
- 'ymd' =. 3 {. 6!:0 ''
- mth=. _3[\' JanFebMarAprMayJunJulAugSepOctNovDec'
- t=. (2":d),' ',(m{mth),3":100|y
- hdr=. (11#TAB),t,' Page '
-
- wd 'winexec "write.exe ',scratch,'";'
- wddl 'sendkeys "n+^{end}%cfCourier New{tab}{tab}9~^{home}";'
- wddl 'sendkeys "%dp{tab}0.75{tab}0.75{tab}0.75{tab}0.75~";'
- wddl 'sendkeys "%dh%cfCourier New{tab}{tab}9~";'
- wddl 'sendkeys "',hdr,'";'
- wddl 'sendkeys "%dh0.4{tab} {tab}~{tab}{tab}~";'
- wddl 'sendkeys "%fp~";'
- )
-
- NB. prints
- NB. e.g. prints 'files misc ts'
- prints=: 0 : 0
- 'examples\' prints y.
- :
- NB. y. = script filenames, if empty prompt for a name
- $.=. >(0<#y=. y.){$.;L0
- t=. 'mbopen "Select File" "',x.,'" ""'
- t=. t,' "Script(*.js)|*.js|All(*.*)|*.*"'
- t=. t,' ofn_filemustexist;'
- y=. wddata t
- $.=. L1
-
- L0) $.=. >(16<3!:0 y){$.;L1
- y=. (<'') -.~ <;._1 ' ',y
- js=. , #&'.js'@(-.@('.'&e.))
- y=. x.&, &.> js &.> y
-
- L1) prfiles y
- )
-
- NB. reads
- reads=: '''examples\'' reads y.' : '1!:1 <x.,y.,''.js'''
-